package br.usp.pcs.basys.event;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;

import br.usp.pcs.basys.Job;

public class Action {
	private final Date instante;
	private final ComputerSystemEvent systemEvent;
	private final Job job;
	private final List<ActionResult> actionResults = new ArrayList<ActionResult>();

	public Action(Date instante, ComputerSystemEvent systemEvent, Job job) {
		super();
		this.instante = instante;
		this.systemEvent = systemEvent;
		this.job = job;
	}

	@Override
	public String toString() {
		return "Action! Date: " + instante.getTime() + "\t JobID: " + job
				+ "\t Action:" + systemEvent.getClass().getSimpleName()
				+ "\t Result:" + actionResults.toString();
	}

	public boolean addAll(Collection<? extends ActionResult> c) {
		return actionResults.addAll(c);
	}
}
